/*
 * Copyright (c) Huawei Technologies Co., Ltd. 2023-2023. All rights reserved.
 */

package com.example.omsdkdemo.utils;

import android.util.Log;

/**
 * 功能描述
 *
 * @since 2023-02-27
 */
public final class OmSdkDemoUtil {
    private static final String TAG = "DemoUtil";

    private OmSdkDemoUtil() {
    }

    public static String resultLog(int ret) {
        String method = Thread.currentThread().getStackTrace()[3].getMethodName();
        String str;
        if (ret == 0) {
            str = method + " success";
            Log.i(TAG, str);
        } else {
            str = method + " error,code=" + ret;
            Log.e(TAG, str);
        }
        return str;
    }

    public static String resultLog(String value) {
        String method = Thread.currentThread().getStackTrace()[3].getMethodName();
        String str = method + "=" + value;
        Log.i(TAG, method + "=" + value);
        return str;
    }

    public static String resultLog(boolean value) {
        String method = Thread.currentThread().getStackTrace()[3].getMethodName();
        String str = method + "=" + value;
        Log.i(TAG, method + "=" + value);
        return str;
    }

    public static String resultLog() {
        String method = Thread.currentThread().getStackTrace()[3].getMethodName();
        String str = method + " success";
        Log.i(TAG, str);
        return str;
    }
}
